<template>
 <div class="scroll" ref="wrapper">
     <div class="content">
         <slot></slot>
     </div>
 </div>
</template>

<script>
import BScroll from 'better-scroll'
 export default {
    name:'Scroll',
    mounted(){
    //回调函数
     this.$nextTick(()=>{
         //创建scroll对象
            this.scroll = new BScroll(this.$refs.wrapper,{
                click:true,
                probeType:3,
                pullUpLoad:true
            })
            //position表示位置
            this.scroll.on('scroll',(position)=>{
                this.$emit('scroll',position)
            })
            this.scroll.on('pullingUp',()=>{
                this.$emit('pullingUp')
            })

        })
    }

}

</script>

 
<style scoped>
 
</style>
